package com.ostrich.cloud.ostrichGoodsService.client;

import com.ostrich.cloud.common.result.PageResult;
import com.ostrich.cloud.ostrichGoodsSercice.model.Dto.TypeDto;
import com.ostrich.cloud.ostrichGoodsSercice.model.param.PutTypeParam;
import com.ostrich.cloud.ostrichGoodsSercice.model.param.AddTypeParam;
import com.ostrich.cloud.ostrichGoodsSercice.model.param.SelectTypeParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "typeClient",name="ostrichGoodsService")
@Api("分類接口")
public interface TypeClient {

    @PostMapping("createType")
    @ApiOperation("創建分類接口")
    public void createType(@RequestBody AddTypeParam param);

    @PostMapping("upLoad")
    @ApiOperation("上傳圖片接口")
    public String upLoad(@RequestBody MultipartFile file) throws IOException;

    @PostMapping("selectType")
    @ApiOperation("查询所有分类接口")
    public PageResult<TypeDto> getAllTypeDto(@RequestBody SelectTypeParam param);

    @DeleteMapping("delType")
    @ApiOperation("删除分类接口")
    public Boolean delType(@RequestParam("typeId")Integer typeId);

    @PutMapping("updateType")
    @ApiOperation("修改分类接口")
    public Boolean updateType(@RequestBody PutTypeParam param);



}
